RWTH - Mindstorms NXT Toolbox

NXT_PlaySoundFile

Plays the given sound file on the NXT Brick

Contents

Syntax

NXT_PlaySoundFile(filename, 'loop')

NXT_PlaySoundFile(filename, '', handle)

Description

NXT_PlaySoundFile(filename, loop) plays the soundfile stored on NXT Brick determined by the string filename. The maximum length is limited to 15 characters. The file extension '.rso' is added automatically if it was omitted. If the loop parameter is equal to 'loop' the playback loop is activated.

NXT_PlaySoundFile(name, loop, handle) uses the given NXT connection handle. This should be a a struct containing a serial handle on a PC system and a file handle on a Linux system.

If no Bluetooth handle is specified the default one (COM_GetDefaultNXT) is used.

For more details see the official LEGO Mindstorms communication protocol.

Examples

   NXT_PlaySoundFile('Goodmorning', 0);
   handle = NXT_OpenNXT('bluetooth.ini','check');
   NXT_StartProgram('Goodmorning.rso', 1, handle);

See also

NXT_StopSoundPlayback

Signature